<?php
namespace app\admin\controller\v1;

use app\common\service\AccountService;
use think\exception\ValidateException;

/**
 * @author : SN
 * @time   : 2020/3/30 16:47
 * @des    : 账号
 */
class Account extends Admin
{

    public function get(){
        return 'get';
    }

    public function add()
    {
        //1.校验数据
        $request_data = $this->request->post();
        $validate = new \app\admin\validate\Account();
        $validate->checkData($request_data);

        //2.添加账号
        $accountService = new AccountService();
        $accountService->addAccount($request_data);

        return show(0, '添加成功');
    }

}